var hexin = {
	init:function(){
		//左侧菜单初始化
		$("#west").parent('.panel').css({
			'bottom':'40px',
			'overflow-y':'auto',
			'width':'210px'
		})
	},
	leftNavClick:function(){
		//左侧导航点击事件
		var panelHeader = $(".leftnav").find('.panel-header');
		panelHeader.click(function(){
			panelHeader.removeClass('click-active');
			$(this).addClass('click-active');
			//zhaocan 2018-04-25左侧菜单点击事件
			var indexItmem =$(this).next(".index-items");
			if(indexItmem.length>0){
				var menuUrl =indexItmem[0].getAttribute("menuurl");
				var menuName =indexItmem[0].getAttribute("menuname");
				var menuIcon =indexItmem[0].getAttribute("menuicon");
				//menuUrl ="/home_callCenter";
				if(menuUrl!=null && menuUrl!=""){
					var tab = new HgUi.Tab();
					tab.commonAdd(menuName,menuUrl,null,menuIcon);
				}
			}
		})
	},
	setTableHeight:function(){
		var clientHeight = $(window).height();
		var setheight = clientHeight-410;
		$(".table-edit .datagrid-wrap").css({'height':setheight,'max-height':setheight})
		$(".table-edit .datagrid-btable tbody").css({'height':setheight})
		$(".table-edit .datagrid-view").css({'height':setheight})
		$(".table-edit .datagrid-view2 .datagrid-body").css({'max-height':setheight-40})
	},
	//客服类工单筛选弹层
	filterShow:function(){
		var onOff = true;
		var oSelect = $(".js-select");
		var filterBox = $(".filter-main-wrap");
		
		oSelect.click(function(ev){
			if(onOff){
				filterBox.show()
			}else{
				filterBox.hide();
			}
			onOff = !onOff;
			ev.stopPropagation();
		});
		
		filterBox.click(function(ev){
			ev.stopPropagation();
		})
		$(document).click(function(){
			filterBox.hide();
			onOff = true;
		})
	},
	//tab切换
	jstablcon:function(){
		var abtns = $(".jstablcon").find('.tabs-tab-wrap').find('a');
		var adivs = $(".jstablcon").find('.jsys-control');
		abtns.click(function(){
			abtns.removeClass('tab-active');
			$(this).addClass('tab-active');
			adivs.hide();
			adivs.eq($(this).index()).show();
		})
	},
	//设置echarts显示区域
	setEcharts:function(parObj,echObj,awidth){
		var parWidth = parObj.width();
		var newWidth = 0;
		if(parWidth>awidth){
			newWidth = awidth
		}else if(parWidth == awidth){
			newWidth = awidth
		}else{
			newWidth = parWidth;
		}
		echObj.css({'width':newWidth,'height':newWidth});
		echObj.find('canvas').css({'width':newWidth,'height':newWidth});
	}
}
